#include "log_err.h"
#include "machine.h"

word bltn_plus(word x, word y) {
  if(TAG(x) != tag_integer) {
    log_err("first argument had type %s, not an integer", tag_name[TAG(x)]);
  }
  if(TAG(y) != tag_integer) {
    log_err("second argument had type %s, not an integer", tag_name[TAG(y)]);
  }
  return OBJECT_TAG_VAL(tag_integer, (VAL(x) + VAL(y)) & VAL_BITS);
}

